﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Lucandra.Configuration;

namespace Lucandra.Net
{
    static class Settings
    {
        public const string Delimeter = "\uFFFF";
        //public const string FinalToken = "\uFFFE\uFFFE";

        public static readonly int DefaultTermReadAhead;
        public static readonly string Keyspace;
        public static readonly string DocumentsColumnFamily; // Documents
        //public static readonly string FieldInfoColumnFamily = "F"; // FieldInfo
        public static readonly string TermInfoColumnFamily; // TermInfo
        public static readonly string IndexedTermsColumn; // Documents => Indexed Terms
        public static readonly string StoredFieldsColumn; // Documents => Stored Fields
        public static readonly string TermDocumentsColumn; // TermInfo => Documents
        public static readonly bool UseKeyspacePerIndex;

        static Settings()
        {
            var config = LucandraConfigurationSection.GetConfig();

            Keyspace = config.Keyspace;

            DocumentsColumnFamily = config.DocumentsColumnFamily.Name;
            TermInfoColumnFamily = config.TermInfoColumnFamily.Name;

            IndexedTermsColumn = config.DocumentsColumnFamily.IndexedTermSuperColumnName;
            StoredFieldsColumn = config.DocumentsColumnFamily.StoredFieldSuperColumnName;
            TermDocumentsColumn = config.TermInfoColumnFamily.DocumentPointerSuperColumnName;

            DefaultTermReadAhead = config.Caching.TermReadAhead.Value;
            UseKeyspacePerIndex = config.UseKeyspacePerIndex;
        }
    }
}
